#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N;
  int cnt = 0;

  auto isGood = [](int x) {
    for (int i = 1; x; i++, x /= 10) {
      if (x % 2 != i % 2) return false;
    }
    return true;
  };

  for (int i = 1; i <= N; ++i) cnt += isGood(i);
  cout << cnt << endl;
}